package com.earnings.okhttputils.utils.car.utils;

import com.earnings.okhttputils.utils.view.mpchart.charts.Chart;

import java.text.DecimalFormat;
import java.util.ArrayList;

/**
 * Created by Administrator on 2017/6/20 0020.
 */

public class StringUtils {

    public static String TransitionPrice(float price) {
        String sprice = price + "";
        StringBuilder sb = new StringBuilder(sprice);
        sb.insert(4, ",");
        return sb.toString();
    }

    /**
     * 转换价格成固定格式字符串
     * @param price
     * @return
     */
    public static String doublePrice2FromatPriceStr(double price) {
        DecimalFormat df = new DecimalFormat("#,###");
        try {
            return df.format(price);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return "0";
    }

}
